package lu.med.praxiswahl.wahlumed.client.ordonancen;

import java.awt.Component;
import java.awt.Font;

import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;
import javax.swing.DefaultListCellRenderer;


public class OrdonancenListCellRenderer implements ListCellRenderer
{

    @Override
    public Component getListCellRendererComponent(JList list, Object value,
	    int index, boolean isSelected, boolean cellHasFocus)
    {
	DefaultListCellRenderer defaultRenderer = new DefaultListCellRenderer();
	
	JLabel renderer = (JLabel) defaultRenderer.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
	renderer.setText(value.toString());
	
	
	if (isSelected) {
		renderer.setFont(new Font(list.getFont().getName(), Font.BOLD, list.getFont().getSize() + 6));
	}
	else {
		//renderer.setFont(list.getFont());
		renderer.setFont(new Font(list.getFont().getName(), Font.PLAIN, list.getFont().getSize() + 6));
	}
	
	return renderer;
    }

}
